package session

import (
	"strings"
)

const KTV_USER_FREE_KEY1 = "08FD48F140E03713DBA002542E0E3BE254AF82DBCA4401E6A3B233FAFE5D946847180C003FC73C21"  //结晶免费注册码
const KTV_USER_FREE_KEY2 = "26248E1E68698238AED9663D47A8B624461D6206DC32B656676A4AE464B1043E"                  //中性注册码
const KTV_USER_FREE_KEY3 = "1F7E184F259F6573FD1D967D2EB525C7A37641C6FA27511726731047520060F3"                  //安美特免费注册码
const KTV_USER_FREE_KEY4 = "3B60DE9DEBA10440966F3CACB40C79AC36A58D4E31E979B74207F3DCDCD41B09"                  //藏乐阁免费注册码
const KTV_USER_FREE_KEY5 = "1C903FDAFBFC580C7600B3381C2CE7B840F637450F4A35CDAC7B9F3BE4BFC62A"                  //视创
const KTV_USER_FREE_KEY6 = "7C4DF416F8E3F962BE758D6E8C93ACFA0F9C7919E97689D391CAB2E84F220EE4C26470580C08ED5D"  // 频点云
const KTV_USER_FREE_KEY7 = "714E7F38901E512233AC392C2D0B2DB287CA4849313F25B2C2CC8C13F6EB9ADFCC2448EC1B5D6787"  // 视创云
const KTV_USER_FREE_KEY8 = "7060F5C9BE05BE5A79231353F4271809010CE7DAB74BD9BA27C6BA3BE2BB08FAB890A88AD3857E9F"  // 中性云
const KTV_USER_FREE_KEY9 = "899270B78E56E012A8B7A4E079A7CE16B2CD26411D6CA5DE60DD635114FFD64C"                  // 藏乐阁云下载
const KTV_USER_FREE_KEY10 = "FA536ACDF37D6D365A12488DCE1BD8F82E73353987F6B19A0FE1C6F0A4B3F651"                 // 鸡西任总
const KTV_USER_FREE_KEY11 = "44FD36800251A867EB236A84DBE7854D3AFE07A5632E7196F6F3B4CC2395E188"                 // 鸡西任总云
const KTV_USER_FREE_KEY12 = "509B58CF9F6FFD0C4B5CDFDC607FC15E177ED240A75F2BC3EEE307B02170A1D3"                 // 长沙深度
const KTV_USER_FREE_KEY13 = "D20EDB336F173C074A03D238D639751B6209257009E73985B9E0C523B81418F1"                 //曹朝忠云
const KTV_USER_FREE_KEY14 = "DAEDC6C5CD303840E16902D14DC1EF8FC8029E5B991D4E2333C3A8DD62FB2CEC9CFFDE49BB57E386" //bluestart云
const KTV_USER_FREE_YUZONG = "89C8A319031D85719878F14C6705BED6DD35E28ACEF95CC63E9769129928E3A6"                // 花都于总云下载
const KTV_USER_FREE_MIANDIAN_DUAN = "7CE442419D22D12CA01ECEEA999E3BE0A1839128F7C3200B687454415E58BC2F"  // 缅甸段先生

var FreeCodeList = []string{
	KTV_USER_FREE_KEY1,
	KTV_USER_FREE_KEY2,
	KTV_USER_FREE_KEY3,
	KTV_USER_FREE_KEY4,
	KTV_USER_FREE_KEY5,
	KTV_USER_FREE_KEY6,
	KTV_USER_FREE_KEY7,
	KTV_USER_FREE_KEY8,
	KTV_USER_FREE_KEY9,
	KTV_USER_FREE_KEY10,
	KTV_USER_FREE_KEY11,
	KTV_USER_FREE_KEY12,
	KTV_USER_FREE_KEY13,
	KTV_USER_FREE_KEY14,
	KTV_USER_FREE_YUZONG,
	KTV_USER_FREE_MIANDIAN_DUAN,
}

// 是否免费注册码
func IsFreeCode(userCode string) bool {
	// 检查是否在免费注册码列表里面
	count := len(FreeCodeList)
	for i := 0; i < count; i++ {
		if strings.EqualFold(userCode, FreeCodeList[i]) {
			return true
		}
	}

	return false
}

// 部分客户调整参数
func AdjustUserInfo(userCode string, userinfo *KtvUserInfo) {

	//长沙频点的速度改为2000K
	if userCode == KTV_USER_FREE_KEY6 {
		userinfo.Speed = 2000
	}

	//bluestart的速度改为2000K
	if userCode == KTV_USER_FREE_KEY14 {
		userinfo.Speed = 2000
	}

}
